import simpy


def my_process(env):
    print("Start of my_process")
    yield env.timeout(2)  # Internal yield
    print("Resuming my_process")
    yield env.timeout(3)  # Internal yield
    print("End of my_process")


def main_process(env):
    # Main process
    print("Main Process: Waiting for p")
    # yield p  # External yield
    env.process(my_process(env))  # Create and start the process
    print("Main Process: Resuming after p")


env = simpy.Environment()
env.process(my_process(env))  # Start the main_process

env.run(until=10)
